<html>
<head>
<script src="CHANGE__PASSWORD__HERE.js"></script>
<script src="common/cryptoJS-md5-min.js"></script>
<script src="common/common.js"></script>
<script src="common/config.js"></script>
<script src="background.js"></script>

<script type = "text/javascript">
		
	if (config.get('currVersion') < 9006)
	{	
		// Because we introduced lastVersion in 9001
		if (config.get('currVersion') == 9000)
			config.set('lastVersion', 9000);
			
		config.set('currVersion', 9006);
		config.set('currDisplayVersion', "0.9.6");
	}
	
	if (isPasswordGood() !== PASSWORD_STATUS.okay)
	{
		showOptionsPage();
	}
	
	
	chrome.tabs.onUpdated.addListener(function(tabid, changeinfo, tab) {
		if (config.get('showPageActionButton'))
		{	
			chrome.pageAction.setIcon({path: "Icons/IconForbidden.png", tabId: tab.id});
			chrome.pageAction.show(tab.id);
			chrome.tabs.sendRequest(tab.id, {type: "get sources for top window"}, function(response){
				if (response.pageSourcesAllowedLength > 0 || response.globalAllowAll)
					chrome.pageAction.setIcon({path: "Icons/IconAllowed.png", tabId: tab.id});
				else
					chrome.pageAction.setIcon({path: "Icons/IconForbidden.png", tabId: tab.id});	
				chrome.pageAction.show(tab.id);
			});				
		}
		else
		{
			chrome.pageAction.hide(tab.id);
		}
	});	
		
</script>
</head>
</html>


